home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 March / EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso / earcd / devel / vbcc-ppc / machines / amiga / doc / vclibppc.doc < prev    next >
Text File  |  1999-01-01  |  5KB  |  236 lines

  1. libvc.a - C library for the AmigaPPC version of vbcc
  2.  
  3.  
  4. INTRODUCTION
  5.  
  6.     libvc.a is a (rather) ANSI compliant C library for use with the
  7.     AmigaPPC (PowerUp) version of vbcc.
  8.  
  9.     It is written largely in C and some parts are not Amiga specific.
  10.  
  11.     Note that some functions dealing with floating point are placed in
  12.     libm.a. Usually you will always want to link with libm.a, too. The
  13.     default configuration will probably handle this. Otherwise you have
  14.     have to specify the option -lm to vc.
  15.  
  16.     Some info about libamiga.a can be found in fd2libPPC.doc.
  17.  
  18.  
  19. LEGAL
  20.  
  21.     libvc.a is public domain. Certain parts have been taken from other
  22.     PD libraries (mainly libnix).
  23.     libm.a is based on libmoto by Motorola, some freely distributable code
  24.     from Sun and PD code. Please see libsrc/math for licenses.
  25.  
  26.  
  27. STARTUP etc.
  28.  
  29.     The startup code will initialize SysBase, DOSBase, stdin, stdout and
  30.     stderr. The arguments are passed from the 68k-side. So programs
  31.     expecting arguments have to be started with ppcrun by Frank Wille.
  32.     If no arguments have to be given, it can be started with PPCLoad or
  33.     PPCDebug, too.
  34.  
  35.  
  36. INLINING
  37.  
  38.     Several header-files provide support for inlining of certain library
  39.     functions. If the preprocessor-symbol __INLINE_<function> is defined
  40.     the corresponding function may be inlined. E.g if you compile with
  41.  
  42.         vc -O3 -D__INLINE_STRCPY
  43.  
  44.     then calls to strcpy() will be inlined. Note however that the symbol
  45.     must be defined at the time string.h is included and, of course, that
  46.     function inlining must be turned on.
  47.  
  48.     Not all library functions are prepared for inlining but only those
  49.     that are reasonably small, are not implemented as macros and can
  50.     safely be inlined. E.g. __INLINE_QSORT will be ignored.
  51.  
  52.     The symbol __INLINE_ALL will cause inlining of all functions which
  53.     can be inlined.
  54.  
  55.     You must have the source to the library functions in the appropriate
  56.     directories, e.g. strcpy must be reachable via
  57.  
  58.         #include "vbccppc:libsrc/string/strcpy.c"
  59.  
  60.     (This could be a problem when cross-compiling.)
  61.  
  62.     Also inline-assembly code is provided for several functions if the
  63.     correct header was included. This also works without optimizations
  64.     turned on.
  65.  
  66.  
  67. STDIO
  68.  
  69.     The following functions are implemented at the moment:
  70.  
  71.     fopen()     binary and text modes are the same
  72.     fclose()
  73.     fflush()
  74.     fgetc()
  75.     ungetc()
  76.     fputc()
  77.     fgets()
  78.     fputs()
  79.     fread()
  80.     fwrite()
  81.     gets()      never use it...
  82.     puts()
  83.     ftell()
  84.     fseek()
  85.     remove()
  86.     rename()
  87.     rewind()
  88.     setvbuf()
  89.     setbuf()
  90.     feof()
  91.     ferror()
  92.     prerror()
  93.     tmpnam()
  94.     tmpfile()   always returns an error at the moment
  95.     fgetpos()
  96.     fsetpos()
  97.     printf()    taken from libnix
  98.     fprintf()     "
  99.     sprintf()     "
  100.     vprintf()     "
  101.     vfprintf()    "
  102.     vsprintf()    "
  103.     scanf()       "
  104.     fscanf()      "
  105.     sscanf()      "
  106.  
  107.     There are macros for a few functions. Some of them will cause a
  108.     warning 129. This is necessary to make them fully conforming. You can
  109.     safely ignore those warnings or use -dontwarn=129.
  110.  
  111.  
  112. STDLIB
  113.  
  114.     The following functions do exist.
  115.  
  116.     malloc()
  117.     free()
  118.     calloc()
  119.     realloc()
  120.     rand()      taken from libnix
  121.     srand()       "
  122.     system()    not yet implemented
  123.     abs()       inline assembly
  124.     labs()      inline assembly
  125.     div()
  126.     ldiv()
  127.     abort()
  128.     atexit()
  129.     getenv()    taken from libnix
  130.     qsort()       "
  131.     bsearch()     "
  132.     strtol()      "
  133.     strtoul()     "
  134.     atol()        "
  135.     atoi()        "
  136.     atof()      taken from libnix; placed in libm.a
  137.     strtod()      "
  138.  
  139.  
  140. TIME
  141.  
  142.     The standard functions should exist. Taken from libnix.
  143.     clock() always returns -1.
  144.  
  145.     CAUTION: time() is very slow! Calling it frequently can really
  146.              kill performance!
  147.  
  148.  
  149. STRING
  150.  
  151.     The standard functions should exist.
  152.     Inline assembly is provided for several functions.
  153.  
  154.  
  155. CTYPE
  156.  
  157.     The standard functions should exist.
  158.  
  159.  
  160. LIMITS
  161.  
  162.     No functions.
  163.  
  164.  
  165. FLOAT
  166.  
  167.     I do not know what has to be there, yet, but the most important things
  168.     should be there (and approximately correct). No functions.
  169.  
  170.  
  171. MATH
  172.  
  173.     The following functions are contained in libm.a. See libsrc/math/* for
  174.     licenses.
  175.  
  176.     sin(), cos(), tan()
  177.     sinh(), cosh(), tanh()
  178.     asin(), acos(), atan(), atan2()
  179.     exp(), log(), log10(), pow()
  180.     ceil(), floor()
  181.     sqrt()
  182.     fabs()
  183.     fmod()
  184.     ldexp(). frexp()
  185.  
  186.  
  187. STDDEF
  188.  
  189.     Currently defines size_t, fpos_t, ptrdiff_t, wchar_t, time_t, clock_t,
  190.     NULL and offsetof. No functions.
  191.  
  192.  
  193. STDARG
  194.  
  195.     Defines va_list, va_start, va_arg and va_end.
  196.  
  197.  
  198. ASSERT
  199.  
  200.     Not really tested yet. No functions.
  201.  
  202.  
  203. ERRNO
  204.  
  205.     The include file and errno is there, but most functions do not set
  206.     errno. No functions.
  207.  
  208.  
  209. SETJMP
  210.  
  211.     Taken from NetBSD.
  212.  
  213.  
  214. SIGNAL
  215.  
  216.     signal() and raise() are there, but always return an error.
  217.  
  218.  
  219. LOCALE
  220.  
  221.     localeconv() and setlocale() are there, but setlocale() does not do
  222.     anything.
  223.  
  224.  
  225. Again, there may be some errors or missing things in the include files
  226. and the library.
  227.  
  228.  
  229. COMPILING
  230.  
  231.     See the Makefile.
  232.  
  233.  
  234. Volker                                              volker@vb.franken.de
  235.  
  236.